#!/usr/bin/env perl

# scrable dictionary generator 0.1 - turns dictionary files into json

use strict;
use JSON;

print 'window.wl=';

my @w = map +{}, 1 .. 50;
while(<>){
	chomp;
	$_ = uc $_;
	next if length($_ == 1) || /Q(?!U)/;
	s/QU/Q/g;
	$w[ord(substr $_, 0, 1) + ord(substr $_, 1, 1) - 130]{$_} = 1;
}

my $w = encode_json(\@w);
$w =~ tr/"//d; #"

print $w;
